package com.hyg.lib_common.DataModel.personal;

import com.hyg.lib_base.mainUtils.Utils;

import java.text.NumberFormat;

/**
 * @author: Administrator
 * @date: 2020/12/7
 */
public class UserDetail {

    int id;
    int userId;
    String realName;
    String gender;
    String idNumber;
    String socialId;
    String address;
    String marryInfo;
    String historyInfo;
    String operationInfo;
    String allergyInfo;
    String familyInfo;
    String tasteInfo;
    String headIcon;
    String createTime;
    String updateTime;

    public String getComputeProgress() {
        double sum = 12.00;
        if (Utils.isEmpty(realName)) sum--;
        if (Utils.isEmpty(gender)) sum--;
        if (Utils.isEmpty(idNumber)) sum--;
        if (Utils.isEmpty(socialId)) sum--;
        if (Utils.isEmpty(address)) sum--;
        if (Utils.isEmpty(marryInfo)) sum--;
        if (Utils.isEmpty(historyInfo)) sum--;
        if (Utils.isEmpty(operationInfo)) sum--;
        if (Utils.isEmpty(allergyInfo)) sum--;
        if (Utils.isEmpty(familyInfo)) sum--;
        if (Utils.isEmpty(tasteInfo)) sum--;
        if (Utils.isEmpty(headIcon)) sum--;
        NumberFormat nt = NumberFormat.getPercentInstance();
        nt.setMinimumFractionDigits(2);
        double percent = sum / 12D;
        return nt.format(percent);
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getIdNumber() {
        return idNumber;
    }

    public void setIdNumber(String idNumber) {
        this.idNumber = idNumber;
    }

    public String getSocialId() {
        return socialId;
    }

    public void setSocialId(String socialId) {
        this.socialId = socialId;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getMarryInfo() {
        return marryInfo;
    }

    public void setMarryInfo(String marryInfo) {
        this.marryInfo = marryInfo;
    }

    public String getHistoryInfo() {
        return historyInfo;
    }

    public void setHistoryInfo(String historyInfo) {
        this.historyInfo = historyInfo;
    }

    public String getOperationInfo() {
        return operationInfo;
    }

    public void setOperationInfo(String operationInfo) {
        this.operationInfo = operationInfo;
    }

    public String getAllergyInfo() {
        return allergyInfo;
    }

    public void setAllergyInfo(String allergyInfo) {
        this.allergyInfo = allergyInfo;
    }

    public String getFamilyInfo() {
        return familyInfo;
    }

    public void setFamilyInfo(String familyInfo) {
        this.familyInfo = familyInfo;
    }

    public String getTasteInfo() {
        return tasteInfo;
    }

    public void setTasteInfo(String tasteInfo) {
        this.tasteInfo = tasteInfo;
    }

    public String getHeadIcon() {
        return headIcon;
    }

    public void setHeadIcon(String headIcon) {
        this.headIcon = headIcon;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "UserDetail{" +
                "id=" + id +
                ", userId=" + userId +
                ", realName='" + realName + '\'' +
                ", gender='" + gender + '\'' +
                ", idNumber='" + idNumber + '\'' +
                ", socialId='" + socialId + '\'' +
                ", address='" + address + '\'' +
                ", marryInfo='" + marryInfo + '\'' +
                ", historyInfo='" + historyInfo + '\'' +
                ", operationInfo='" + operationInfo + '\'' +
                ", allergyInfo='" + allergyInfo + '\'' +
                ", familyInfo='" + familyInfo + '\'' +
                ", tasteInfo='" + tasteInfo + '\'' +
                ", headIcon='" + headIcon + '\'' +
                ", createTime='" + createTime + '\'' +
                ", updateTime='" + updateTime + '\'' +
                '}';
    }
}
